/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * | 勘察设计院复审相关接口模块
 * +----------------------------------------------------------------------
 */
layui.define(['jquery', 'configure', 'configureCom', 'bluebird'], function (exports) {
    var configure = layui.configure;
    var configureCom = layui.configureCom;
    var reviewExamineAPI = {
        param: {
            data: {
                projBdstId: -1,//标段ID
                singProjectId: -1,//单位工程ID
                adviseId: -1,//意见ID
                replyTxt: ''//回复消息
            }
        },
        reAuditApply: function () {
            //提交复审
            return new Promise(function (resolve, reject) {
                var applyUrl = configure.RE_AUDIT_APPLY_HTTP;
                reviewExamineAPI.param.data.singleProjId = reviewExamineAPI.param.data.singProjectId;
                reviewExamineAPI.param.data.bdstId = reviewExamineAPI.param.data.projBdstId;
                configureCom.putDataAjax(applyUrl, reviewExamineAPI.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        reply: function () {
            //复审意见回复提交
            return new Promise(function (resolve, reject) {
                var replyUrl = configure.RE_AUDIT_APPLY_REPLY_HTTP;
                configureCom.putDataAjax(replyUrl, reviewExamineAPI.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        }
    };
    exports('reviewExamineAPI', reviewExamineAPI);
});